import { INIT_INPUT_DATA ,INIT_MALL_INFO,INIT_SORE_DATA} from "../../actionType/searchType";
import { getInputData,getMallInfo,getevaluteData } from "../../../http/api";

export const inputAction = (geohash, keyword,inputListArr) => {
  return async (dispath) => {
    const res = await getInputData(geohash, keyword);
    // console.log(res);
    dispath({
      type: INIT_INPUT_DATA,
      payload: {
        inputData: res,
        // inputListArr: inputListArr, //关键词数组
      
      },
    });
  };
};


export const getMallInfoAction=(index)=>{
  return async(dispatch)=>{
    let res=await getMallInfo(index)
    console.log('getMallInfoAction获取的结果',res);
    dispatch({
      type:INIT_MALL_INFO,
      payload:{
        MallInfo:res
      }
    })
  }
}


export const evaluteAction=(id)=>{
  return async(dispatch)=>{
    let res= await getevaluteData(id)
    dispatch({
      type:INIT_SORE_DATA,
      payload:{
        evaluteScoreData:res
      }
    })
  }
}